/** When your routing table is too long, you can split it into small modules **/

import Layout from '@/layout'

export const goodsRouter = {
  path: '/goods',
  component: Layout,
  redirect: '/goods/index',
  name: 'Goods',
  meta: {
    title: '商品管理',
    icon: 'table'
  },
  children: [
    {
      path: 'index',
      component: () => import('@/views/goods/index'),
      name: '商品列表',
      meta: { title: '商品列表' }
    },
    {
      path: ':type?/:id?',
      component: () => import('@/views/goods/edit'),
      name: '商品编辑',
      meta: { title: '商品编辑' },
      hidden: true
    },
    {
      path: 'cate',
      component: () => import('@/views/goods/cate'),
      name: '商品分类',
      meta: { title: '商品分类' }
    }
  ]
}
export const storeRouter = {
  path: '/store',
  component: Layout,
  redirect: '/store/index',
  name: 'Store',
  meta: {
    title: '门店管理',
    icon: 'table'
  },
  children: [
    {
      path: 'index',
      component: () => import('@/views/store/index'),
      name: '门店列表',
      meta: { title: '门店列表' }
    },
    {
      path: 'info',
      component: () => import('@/views/store/info'),
      name: '门店信息',
      meta: { title: '门店信息' }
    },
    {
      path: 'account',
      component: () => import('@/views/store/account'),
      name: '门店账号',
      meta: { title: '门店账号' }
    },
    {
      path: '',
      component: () => import('@/views/store/printMould'),
      name: '订单打印模板',
      meta: { title: '订单打印模板' }
    }
  ]
}

export const stockRouter = {
  path: '/store/stock',
  component: Layout,
  redirect: '',
  meta: {
    title: '库存管理',
    icon: 'table'
  },
  children: [
    {
      path: '',
      component: () => import('@/views/store/stock'),
      name: '库存信息',
      meta: { title: '库存信息' }
    }
  ]
}
export const orderRouter = {
  path: '/order',
  component: Layout,
  redirect: '/order/index',
  meta: {
    title: '订单管理',
    icon: 'table'
  },
  children: [
    {
      path: 'index',
      component: () => import('@/views/order/index'),
      name: '订单管理',
      meta: { title: '订单管理' }
    },
    {
      path: 'detail/:id',
      component: () => import('@/views/order/detail'),
      name: '订单详情',
      meta: { title: '订单详情' }
    },
    {
      path: 'add/:time',
      component: () => import('@/views/order/add'),
      name: '新增订单',
      meta: { title: '新增订单' },
      hidden: true
    },
    {
      path: ':operateType/:id/:time?',
      component: () => import('@/views/order/add'),
      name: '订单',
      meta: { title: '新增订单' },
      hidden: true
    }
  ]
}
export const customerRouter = {
  path: '/customer',
  component: Layout,
  redirect: '/customer/index',
  meta: {
    title: '客户管理',
    icon: 'table'
  },
  // hidden: true,
  children: [
    {
      path: 'index',
      component: () => import('@/views/customer/index'),
      name: '客户管理',
      meta: { title: '客户管理' }
    },
    {
      path: 'detail/:id',
      component: () => import('@/views/customer/detail'),
      name: '客户详情',
      meta: { title: '客户详情' }
    },
    {
      path: 'add/:time',
      component: () => import('@/views/customer/add'),
      name: '新增客户',
      meta: { title: '新增客户' },
      hidden: true
    }
  ]
}
export const systemRouter = {
  path: '/system',
  component: Layout,
  // redirect: '/store/stock',
  meta: {
    title: '系统设置',
    icon: 'table'
  },
  children: [
    {
      path: 'dict',
      component: () => import('@/views/system/dict'),
      name: '字典管理',
      meta: { title: '字典管理' }
    }
  ]
}

// export {
//   goodsRouter,
//   storeRouter
// };
